// example sample data and code
(function(){
    // some sample data
    // global var "data"
    data = [["t","w","x","q"]];
    
          //var url = "http://localhost:8080/logistics-ws/services/BasicManageService";
            
          var url = "/logistics-ws/services/BasicManageService";
         
                var pl = new SOAPClientParameters();
                SOAPClient.invoke(url, "getAllPlacevo", pl, false,  function GetUsers_callBack(ul, soapResponse){
              
				ul=ul.out;
				//var rs="";
				//alert(ul.length + " user(s) found:");
        		for(var i = 0; i < ul.length; i++){		
        		//	rs=rs+
        				"User No. " + (i + 1) + "\r\n" +
        				"ID: " + ul[i].placeName + "\r\n\r\n";
        				
        	    //alert(rs);
                //document.getElementById("repxml").innerText = soapResponse.xml;
				//document.getElementById("result").innerText = rs;
				var items = new Array();
                items[0] = ul[i].area;
                items[1] = ul[i].placeName;
                items[2] = ul[i].postCode;
                items[3] = ul[i].province;
                data[i]=items;
                }
                
            });
            
    
    
    //    var rows = 100;
    //    for (var i = 0, l = data.length; i < rows - l; i++) {
    //        data.push(data[i % l].slice(0));
    //    }
    
    // global var "model"
    model = new dojox.grid.data.Table(null, data);
    dojo.byID('grid').refresh();
    // simple display of row info; based on model observation
    // global var "modelChange"
    modelChange = function(){
        var n = dojo.byId('rowCount');
        if (n) {
            n.innerHTML = Number(model.getRowCount()) + ' row(s)';
        }
    }
})();
